package com.heima.article.job;

/**
 * @author : Liu
 * @date : 2022/1/6 0006 20:59
 */

import com.heima.article.service.QueryByThreadService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时将文章导入到ES
 */
@Component
@Slf4j
public class ComputeSqlToEsJob {
@Autowired
private QueryByThreadService queryByThreadService;

    @XxlJob("computeSqlToEsJob")
    public void ComputeSqlToEsJob() throws Exception {
        log.info("开始执行Mysql导入Es {}");
        queryByThreadService.queryByThread();
    }
}
